package com.cbd.pojo;

import java.io.Serializable;
import java.util.*;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotEmpty;
import org.springframework.validation.annotation.Validated;

/**
 * 投诉记录
 * 
 */
@Entity
@Table(name="complaintrecord")
@Validated
public class Complaintrecord implements Serializable{
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name="id")
	private int id;
	/**
	 * 投诉理由
	 * 
	 */
	@Column(name="reason")
	@NotEmpty(message="不能为空")
	@Length(max=50,min=5,message="长度必须为5-50位之间")
	private String reason;
	/**
	 * 投诉状态 0：没有处理 false 1：处理true
	 * 
	 */
	@Column(name="type")
	private boolean type;
	/**
	 * 投诉方： 0：租客投诉包租婆 false 1：包租婆 投诉租客true
	 * 
	 */
	@Column(name="compaint")
	private boolean complaint;
	/**
	 * 投诉日期
	 * 
	 */
	@Column(name="createtime")
	private Date time;
	@OneToOne(cascade=CascadeType.ALL)
	@JoinColumn(name="recordID")
	private Record record;

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getReason() {
		return reason;
	}

	public void setReason(String reason) {
		this.reason = reason;
	}

	public boolean isType() {
		return type;
	}

	public void setType(boolean type) {
		this.type = type;
	}

	public boolean isComplaint() {
		return complaint;
	}

	public void setComplaint(boolean complaint) {
		this.complaint = complaint;
	}

	public Date getTime() {
		return time;
	}

	public void setTime(Date time) {
		this.time = time;
	}

	public Record getRecord() {
		return record;
	}

	public void setRecord(Record record) {
		this.record = record;
	}

}